/*
 * Tunnel.h
 *
 *  Created on: 2009-3-27
 *      Author: pww
 */

#ifndef TUNNEL_H_
#define TUNNEL_H_

#include "SocketPlus/Socket.h"
#include "Session.h"

class Session;

class Tunnel:public Socket {
private:
	Session * cli;
public:
	Tunnel();
	int OnRead(Epoller & sender, EpollEventArg &e);
	int OnWrite(Epoller & sender, EpollEventArg &e);

	int SetPeerAddr(SockAddr & addr) {
		memcpy(m_peer_addr, &addr, sizeof(addr));
		return 0;
	}

	int Send();
	void Dispatcher(Session * ss);
	virtual ~Tunnel();
};

#endif /* TUNNEL_H_ */
